package com.xique.park.bean.transform.web.car;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * 支付类型转换
 */
public class PayTypeConverter implements Converter<String> {

    @Override
    public Class<String> supportJavaTypeKey() {
        return String.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public String convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) {
        return null;
    }

    @Override
    public CellData<String> convertToExcelData(String s, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) {
        switch (s) {
            case "0":
                return new CellData<>("P云");
            case "1":
                return new CellData<>("现金");
            case "2":
                return new CellData<>("ETC");
            case "3":
                return new CellData<>("余额");
            case "4":
                return new CellData<>("支付宝");
            case "8":
                return new CellData<>("微信");
            case "9":
                return new CellData<>("免费");
            case "10":
                return new CellData<>("其他");
            case "20":
                return new CellData<>("数字人名币");
            default:
                return new CellData<>("");
        }
    }

}
